home *** CD-ROM | disk | FTP | other *** search
/ El Mac 1 / Magazine.iso / EL MAC 1 / Shareware / HyperCard / XCMD Docs / CompileIt! Source Code / backToPict text < prev    next >
Encoding:
Text File  |  1995-08-20  |  1.6 KB  |  60 lines  |  [TEXT/ttxt]

  1. global rgb:R[6],c:C
  2.  
  3. on backToPict text -- text MUST have returns
  4.   put the number of lines in text into vv
  5.   put (the number of chars in line 1 of text)+1 into hh
  6.   put charsHandle(text) into hand
  7.   put hand@ into ptr
  8.   repeat with v=1 to vv
  9.     repeat with h=1 to hh
  10.       put char 1 of pointer ptr into c -- HA! HA! Pointer Arithmatic!
  11.       -- NEVER USE “IT” BECAUSE “IT” IS SLOWER THAN SLOW!!!!
  12.       if c="•" then
  13.         put 0 into rgb.integertype[1]
  14.         put 0 into rgb.integertype[2]
  15.         put 0 into rgb.integertype[3]
  16.         setCPixel h,v,rgb
  17.         add one to ptr
  18.         next repeat
  19.       end if
  20.       if c="w" then
  21.         -- asume already white, great speedup
  22.         add one to ptr
  23.         next repeat
  24.       end if
  25.       if c="r" then
  26.         put 65535 into rgb.integertype[1]
  27.         put 0 into rgb.integertype[2]
  28.         put 0 into rgb.integertype[3]
  29.         setCPixel h,v,rgb
  30.         add one to ptr
  31.         next repeat
  32.       end if
  33.       if c="g" then
  34.         put 0 into rgb.integertype[1]
  35.         put 65535 into rgb.integertype[2]
  36.         put 0 into rgb.integertype[3]
  37.         setCPixel h,v,rgb
  38.         add one to ptr
  39.         next repeat
  40.       end if
  41.       if c="b" then
  42.         put 0 into rgb.integertype[1]
  43.         put 0 into rgb.integertype[2]
  44.         put 65535 into rgb.integertype[3]
  45.         setCPixel h,v,rgb
  46.         add one to ptr
  47.         next repeat
  48.       end if
  49.       if c="y" then
  50.         put 65535 into rgb.integertype[1]
  51.         put 65535 into rgb.integertype[2]
  52.         put 0 into rgb.integertype[3]
  53.         setCPixel h,v,rgb
  54.         add one to ptr
  55.         next repeat
  56.       end if
  57.       add one to ptr
  58.     end repeat
  59.   end repeat
  60. end BackToPict